package org.shopen.puremvc.controller.theory
{
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	import org.puremvc.as3.utilities.statemachine.StateMachine;
	import org.shopen.puremvc.ApplicationConstants;
	import org.shopen.puremvc.model.StagesProxy;
	import org.shopen.puremvc.model.domain.theory.StageMeta;

	public class SelectStageCommand extends SimpleCommand
	{
		override public function execute(notification:INotification):void
		{
			var stageMeta : StageMeta = notification.getBody() as StageMeta;
			var stagesProxy : StagesProxy = facade.retrieveProxy(StagesProxy.NAME) as StagesProxy;
			stagesProxy.setCurrentStage(stageMeta.id);
			
			sendNotification(StateMachine.ACTION, notification.getBody(), ApplicationConstants.ACTION_READ_STAGE);
		}
	}
}